#include "helper.h"
using namespace Helper;
void setup(BridgeConfig &cfg)
{
    dbgcfg.dbgen = cfg.dbgoutput;
    dbgcfg.dbglevel = cfg.dbglevel;
    dbgcfg.logen = cfg.log;
    dbgcfg.loglevel = cfg.loglevel;
}

void log(const char *file, int level, const char *str, ...)
{
    if(dbgcfg.dbgen || level < dbgcfg.dbglevel)
        return;
    if(file)
        printf("\033[36m[%s]\033[0m ",file);
    if(level == 1) printf("\033[33m");
    else if(level == 2) printf("\033[31m");
    va_list args;
    va_start(args,str); 
    vprintf(str,args);
    va_end(args);
    if(level)
        printf("\033[0m");
    putchar('\n');
}